package com.yuw.singleton;

public class TestDriver1 {
    public static void main(String[] args) {
        // 获取单件模式的一个实例对象
        ShopCartSingleton shopCart1 = ShopCartSingleton.getShopCartInstance();

        ShopCartSingleton shopCart2 = ShopCartSingleton.getShopCartInstance();
        // 判断两次获取的对象是不是同一个对象
        System.out.println("shopCart1 == shopCart2:" + (shopCart1 == shopCart2));
    }
}
